package chpt04;
import java.util.Scanner;

class ArrayUtils{
	
	static class PairResult{
		private double min;
		private double max;
		@Override
		public String toString() {
			return "PairResult [min=" + min + ", max=" + max + "]";
		}
		
	}
	
	public static PairResult findMinMax(double[] values){
		double min=values[0];
		double max=values[0];
		for (double d : values) {
			if(min>d)
				min=d;
			if(max<d)
				max=d;
		}
		PairResult p=new PairResult();
		p.max=max;p.min=min;
		return p;
		
	}
}

public class StaticNestedClass{
	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		int n=in.nextInt();
		double[] values=new double[n];
		for (int i = 0; i < values.length; i++) {
			values[i]=in.nextDouble();
		}
		System.out.println(ArrayUtils.findMinMax(values));
		System.out.println(ArrayUtils.PairResult.class);
		in.close();
	}
}